package cn.green.core.components.setter.defImpl.primary;

import cn.green.core.common.enums.table.PrimaryKeySet;
import cn.green.core.components.setter.PrimaryKey;
import com.alibaba.fastjson.JSONObject;
import cn.green.core.model.QField;
import cn.green.core.scanner.anno.comps.QTableComponent;

/**
 * @author wang.yishu
 * @version 1.0
 * @className AutoIncreaseId
 * @description 自增id
 * @date 2024/11/20 15:06
 */
@QTableComponent
public class AutoIncreaseId implements PrimaryKey {


    @Override
    public PrimaryKeySet primarySetter() {
        return PrimaryKeySet.AUTO_INCREASE;
    }

    @Override
    public void set(QField field, JSONObject record) {
        record.remove(field.getFieldName());
    }
}
